<?php
class addMessage
{
	var $messageText;
	var $messageTitle;
	var $titleOnly;
	var $subTitleMessage;
	
	function addMessage($message, $title, $titleOnly = false, $subTitleMessage = false)
	{
		$this->messageText = $message;
		$this->messageTitle = $title;
		$this->titleOnly = $titleOnly;
		$this->subTitleMessage = $subTitleMessage;
		
		if($message == '')
		{
			$this->titleOnly = true;
		}
	}
	function render()
	{			
		global $skin_dir;
		
		$remTextStart = $this->titleOnly ? '<!--' : '';
		$remTextEnd = $this->titleOnly ? '-->' : '';
		$messageText = $this->messageText;
		$messageTitle = $this->messageTitle;
		if($this->subTitleMessage)
			include($skin_dir . 'tpl/messageSubTitle.tpl');
		else
			include($skin_dir . 'tpl/message.tpl');
			
	}
}
?>